
// 吃到加分道具动画
cc.Class({
    extends: cc.Component,

    properties: {
        scoreLabel: cc.Label,
    },

    init(game, scoreValue) {
        this.game = game;
        this.scoreLabel.string = "+" + scoreValue.toString();
        this._fadeAnim();
    },

    _fadeAnim() {
        var callback = cc.callFunc(this._animFinished, this);
        this.node.runAction(cc.sequence(cc.fadeIn(0.1), cc.fadeOut(0.5), callback));
    },

    _animFinished() {
        this.game.scorePool.put(this.node);
    },
});
